package com.zret.oasys.entity;
/**
 * 考勤表格实体类（根据多表查询的语句，创建实体类）
 * @author 77404
 *
 */

import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;

public class AttenceTable {

	private long serialnum;//考勤流水号
	private int deptid;//部门编号
	private String deptname;//部门名称
	private int empid; //员工id
	private String empname; //员工姓名
	private String position;//员工职位
	private Date attencetime;//考勤时间
	private String attencetype;//考勤状态
	
	// 日期的格式化
	private static SimpleDateFormat simple = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
	//无参构造
	public AttenceTable() {
		
	}
	
	/**
	 * 有参构造1
	 * @param serialnum 考勤流水号
	 * @param deptid 部门id
	 * @param deptname 部门名称
	 * @param empid 员工id
	 * @param empname 员工名称
	 * @param position 职位
	 * @param attencetime Date类型
	 * @param attencetype 考勤类型
	 */
	public AttenceTable(long serialnum, int deptid, String deptname, int empid, String empname, String position,
			Date attencetime, String attencetype) {
		super();
		this.serialnum = serialnum;
		this.deptid = deptid;
		this.deptname = deptname;
		this.empid = empid;
		this.empname = empname;
		this.position = position;
		this.setAttencetime(attencetime);
		this.attencetype = attencetype;
	}

	

	/**
	 * 有参构造2
	 * @param serialnum 考勤刘少
	 * @param deptid 部门id
	 * @param deptname 部门名称
	 * @param empid 员工id
	 * @param empname 员工姓名
	 * @param position 员工职位
	 * @param attencetime 考勤时间
	 * @param attencetype 考勤类型
	 */
	public AttenceTable(long serialnum, int deptid, String deptname, int empid, String empname, String position,
			String attencetime, String attencetype) {
		super();
		this.serialnum = serialnum;
		this.deptid = deptid;
		this.deptname = deptname;
		this.empid = empid;
		this.empname = empname;
		this.position = position;
		this.setAttencetime(attencetime);;
		this.attencetype = attencetype;
	}
	
	
	
	
	
	
	
	

	
	public long getSerialnum() {
		return serialnum;
	}
	public void setSerialnum(long serialnum) {
		this.serialnum = serialnum;
	}
	public int getDeptid() {
		return deptid;
	}
	public void setDeptid(int deptid) {
		this.deptid = deptid;
	}
	public String getDeptname() {
		return deptname;
	}
	public void setDeptname(String deptname) {
		this.deptname = deptname;
	}
	public int getEmpid() {
		return empid;
	}
	public void setEmpid(int empid) {
		this.empid = empid;
	}
	public String getEmpname() {
		return empname;
	}
	public void setEmpname(String empname) {
		this.empname = empname;
	}
	public String getPosition() {
		return position;
	}
	public void setPosition(String position) {
		this.position = position;
	}
	
	
	/**
	 * 获取考勤时间（字符串）
	 * @return
	 */
	public String getAttencetime() {
		return simple.format(attencetime);
	}
	
	/**
	 * 设置考勤时间（Date类型）
	 * @param attencetime
	 */
	public void setAttencetime(Date attencetime) {
		this.attencetime = attencetime;
	}
	
	/**
	 * 设置考勤时间（字符串）
	 * @param attencetime
	 */
	public void setAttencetime(String attencetime) {
		try {
			this.attencetime = simple.parse(attencetime);
		} catch (ParseException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
	}
	
	
	
	
	public String getAttencetype() {
		return attencetype;
	}
	public void setAttencetype(String attencetype) {
		this.attencetype = attencetype;
	}

	
	@Override
	public String toString() {
		return "AttenceTable [serialnum=" + serialnum + ", deptid=" + deptid + ", deptname=" + deptname + ", empid="
				+ empid + ", empname=" + empname + ", position=" + position + ", attencetime=" + this.getAttencetime()
				+ ", attencetype=" + attencetype + "]";
	}
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	

}
